package com.moon.back.service;

import cn.dev33.satoken.util.SaResult;
import com.moon.back.entity.Req.FileQueryReq;
import com.moon.back.entity.Req.UploadFileReq;
import com.moon.back.entity.Resp.FileQueryResp;
import com.moon.back.entity.dto.*;
import org.springframework.core.io.InputStreamResource;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public interface IFileService {

    SaResult fileUpload(UploadFileReq uploadFileReq);

    SaResult getFile(HttpServletRequest request, FileQueryReq fileQueryReq);

    SaResult getAllFileType(HttpServletRequest request, FileTypeDto fileTypeDto);

    void setTypeTotal(FileQueryResp fileQueryResp, Integer type);

    SaResult newDir(HttpServletRequest request, FolderDto folderDto);

    SaResult changeFileName(HttpServletRequest request, FileChangeNameDto fileChangeNameDto);

    SaResult delFileAll(HttpServletRequest request);

    SaResult delFile(HttpServletRequest request, DelFileDto delFileDto);

    SaResult delFileBatch(DelFileBatchDto delFileBatchDto);

    SaResult refresh(RefreshDto refreshDto);

    ResponseEntity<InputStreamResource> downFile(HttpServletRequest request, String path) throws IOException;

    SaResult lookImage(String path, HttpServletRequest request, HttpServletResponse resp) throws IOException;

    SaResult lookDoc(HttpServletRequest request, HttpServletResponse resp, String path) throws IOException;

    SaResult fileHandlerToMatch(Integer operaSign, String fileNameSuffix,String fileNameStr);

    SaResult fileMatchHandler(FileOperaDto fileOperaEntity);
}
